{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f3470081",
   "metadata": {},
   "outputs": [],
   "source": [
    "from ca527 import EyeSensor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b65b7f0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('4F4B30300D', 'OK00\\r')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sensor = EyeSensor(port='COM13')\n",
    "sensor.XYZmode()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f1e7e083",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.3065195, 543.44747, 0.3326462)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sensor.GetXYZ()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7ed42136",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('455231300D', 'ER10\\r')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sensor.JETAmode()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ab941e02",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11.0778"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sensor.GetJETA(timeout=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "30ea4763",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'OK00\\r'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from ca527 import Ca410Sensor\n",
    "\n",
    "sensor = Ca410Sensor(port='COM13')\n",
    "sensor.JETAmode()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "09da711a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60.34778"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sensor.GetJETA(timeout=0.1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "54b5d364",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'OK00\\r'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from OpticalSensor import CA410Sensor\n",
    "\n",
    "sensor = CA410Sensor(port='COM13')\n",
    "sensor.JETAmode()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ba4ced90",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "59.59762"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = sensor.GetJETA()\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "973c9929",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-79.93769,\n",
       " -67.80677,\n",
       " -67.98069,\n",
       " -82.82886,\n",
       " -84.8755,\n",
       " -87.50014,\n",
       " -93.40882,\n",
       " -88.56988,\n",
       " -85.28916,\n",
       " -82.9354,\n",
       " -87.54147,\n",
       " -93.96338,\n",
       " -95.13776,\n",
       " -92.06886,\n",
       " -92.64577,\n",
       " -93.22342,\n",
       " -78.67047,\n",
       " -78.77142,\n",
       " -91.29269,\n",
       " -113.3894,\n",
       " -104.3749,\n",
       " -99.34949,\n",
       " -103.5535,\n",
       " -65.19614,\n",
       " -59.57273,\n",
       " -65.72752,\n",
       " -112.9796,\n",
       " -104.8839,\n",
       " -117.4578,\n",
       " -114.8102,\n",
       " -100.5591,\n",
       " -88.99049,\n",
       " -89.34338,\n",
       " -105.817,\n",
       " -101.6959,\n",
       " -105.3054,\n",
       " -121.5801,\n",
       " -110.9799,\n",
       " -105.3769,\n",
       " -102.6771,\n",
       " -106.5623,\n",
       " -111.5332,\n",
       " -117.2231,\n",
       " -131.2225,\n",
       " -118.6425,\n",
       " -111.1236,\n",
       " -102.2502,\n",
       " -103.1736,\n",
       " -115.6461,\n",
       " -128.6655,\n",
       " -129.8355,\n",
       " -129.4414,\n",
       " -136.9434,\n",
       " -96.30097,\n",
       " -98.99661,\n",
       " -106.7035,\n",
       " -147.3991,\n",
       " -145.0217,\n",
       " -149.9828,\n",
       " -999.0]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = sensor.GetJETASepctrum()\n",
    "result"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
